package flc.ast.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;

import flc.ast.BaseAc;
import flc.ast.R;
import flc.ast.databinding.ActivityAddDrawBinding;
import stark.common.basic.event.EventStatProxy;

public class AddDrawActivity extends BaseAc<ActivityAddDrawBinding> {


    @Override
    protected int onCreate() {
        return R.layout.activity_add_draw;
    }

    @Override
    protected void initView() {
        EventStatProxy.getInstance().statEvent1(this, mDataBinding.event1Container);
        EventStatProxy.getInstance().statEvent5(this, mDataBinding.event5Container);

        mDataBinding.ivAddDrawBack.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                onBackPressed();
            }
        });
        mDataBinding.ivAddDrawImport.setOnClickListener(this);
        mDataBinding.ivDrawSize1.setOnClickListener(this);
        mDataBinding.ivDrawSize2.setOnClickListener(this);
        mDataBinding.ivDrawSize3.setOnClickListener(this);
        mDataBinding.ivDrawSize4.setOnClickListener(this);
        mDataBinding.ivDrawSize5.setOnClickListener(this);
        mDataBinding.ivDrawSize6.setOnClickListener(this);
    }

    @Override
    protected void onClickCallback(View v) {
        switch (v.getId()) {
            case R.id.ivAddDrawImport://导入图片
                startActivity(SelPicActivity.class);
                break;
            case R.id.ivDrawSize1://画布-9:16
                gotoDraw(1);
                break;
            case R.id.ivDrawSize2://画布-3:4
                gotoDraw(2);
                break;
            case R.id.ivDrawSize3://画布-1:1
                gotoDraw(3);
                break;
            case R.id.ivDrawSize4://画布-16:9
                gotoDraw(4);
                break;
            case R.id.ivDrawSize5://画布-4:3
                gotoDraw(5);
                break;
            case R.id.ivDrawSize6://画布-屏幕
                gotoDraw(6);
                break;
        }
    }

    @Override
    protected void initData() {

    }

    //去到绘画界面
    private void gotoDraw(int bili) {
        DrawActivity.kind = 2;
        DrawActivity.bili = bili;
        startActivity(DrawActivity.class);
    }

}